home *** CD-ROM | disk | FTP | other *** search
- -- card: 2926 from stack: in
- -- bmap block id: 0
- -- flags: 0000
- -- background id: 2794
- -- name:
-
-
- -- part 1 (button)
- -- low flags: 00
- -- high flags: 8006
- -- rect: left=302 top=288 right=310 bottom=466
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Import Data Base
- ----- HyperTalk script -----
- --to use this button, prepare at least as many HC background fields
- --as fields separated by tabs of your text data file
- -- by Ted Tripp, 4588 CR 523, Bayfield, CO 81122, 303-884-9029
- on mouseUp
- ask "Import text from which file?"
- if it is empty then exit mouseUp
- put it into fileName
- open file fileName
- set cursor to 4
- repeat
- read from file fileName until return -- get first record
- if it is empty then
- doMenu "Delete Card"
- close file fileName
- exit mouseUp
- end if
- put it into data
- repeat with i = 1 to the number of fields
- put offset(tab,data) into num --gets first field (until tab)
- if num is 0 then -- last field of record has no tab
- put data into field i -- writes last field
- delete last char of field i -- deletes return char
- if first char of field i is quote then
- delete first char of field i
- delete last char of field i
- end if
- exit repeat -- stops
- end if
- put char 1 to (num - 1) of data into field i -- writes first field
- if first char of field i is quote then
- delete first char of field i
- delete last char of field i
- end if
- delete char 1 to num of data -- gets rid of field
- end repeat
- doMenu "New Card"
- end repeat
- close file fileName
- set cursor to 1
- end mouseUp
-
-